<!-- 图片选择器 -->
<template>
    <image-picker
        v-model="currentValue"
        v-bind="attrs"
        class="si-image-picker"
    />
</template>

<script>
import { defineComponent, toRefs, computed } from 'vue'
export default defineComponent({
    name: 'SiImagePicker',
    props: {
        modelValue: {
            type: String,
            default: ''
        }
    },
    emits: [
        'update:modelValue'
    ],
    setup(props, { emit, attrs }) {
        const { modelValue } = toRefs(props)

        const currentValue = computed({
            get: () => modelValue.value,
            set: val => emit('update:modelValue', val)
        })

        return {
            attrs,
            currentValue
        }
    }
})
</script>

<style lang="less" scoped>
.si-image-picker {
    & + .si-image-picker {
        margin-left: 12px;
    }
}
</style>